package net.ojbk.sso.center.util;

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * User: twobox
 * Date: 2019/3/24
 * Time: 9:59
 * Description: No Description
 */
public class RandomStringTool {
    public static final String CHARS_majuscule = "QWERTYUIOPASDFGHJKLZXCVBNM";
    public static final String CHARS_Lowercase_Letters = "qwertyuiopasdfghjklzxcvbnm";
    public static final String CHARS_number = "1234567890";

    public static String getRandomString(String CHARS, int stringLength) {
        Random random = new Random();
        StringBuffer stringBuffer = new StringBuffer("");
        for (int i = 0; i < stringLength; i++) {
            stringBuffer.append(CHARS.charAt(random.nextInt(CHARS.length() + 1) - 1));
        }
        return stringBuffer.toString();
    }
}
